package com.fanjun.learning.multithread.Activity_Object_Pattern;

/**
 * Created by fanjun on 16/10/17.
 */
public class DisplayClientThread extends Thread {
    private final ActivityObject activityObject;
    public DisplayClientThread(String name, ActivityObject activityObject) {
        super(name);
        this.activityObject = activityObject;
    }

    @Override
    public void run(){
        try {
            for (int i = 0; true; i++){
                String value = Thread.currentThread().getName() + " " + i;
                activityObject.displayString(value);
                Thread.sleep(100);
            }
        }catch (InterruptedException ex){

        }
    }
}
